<!-- List Corporate Offices -->

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="layout" content="main" />
    <title>Corporate Offices List for ${company}</title>
  </head>
  <body>
    <div class="body">
      <h1>Corporate Offices List</h1>
      <g:if test="${flash.message}">
        <div class="message">${flash.message}</div>
      </g:if>
      <div class="list">
        <table>
          <thead>
            <tr>
              <g:sortableColumn property="type.name" title="Type" />
              <g:sortableColumn property="name" title="Name" />
              <th>Primary Address</th>
              <g:sortableColumn property="primaryPhone" title="Primary Phone" />
              <th>Primary Email</th>
            </tr>
          </thead>
          <tbody>
            <g:each in="${companyList}" status="i" var="company">
              <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                <td>${fieldValue(bean:company, field:'type')}</td>
                <td><g:link action="summary" id="${company.id}">${fieldValue(bean:company, field:'name')}</g:link></td>
                <td>${fieldValue(bean:company, field:'primaryAddress')}</td>
                <td>${fieldValue(bean:company, field:'primaryPhone')}</td>
                <td>${fieldValue(bean:company, field:'primaryEmail')}</td>
              </tr>
            </g:each>
          </tbody>
        </table>
      </div>
      <div class="paginateButtons">
        <g:paginate total="${companyTotal}" />
      </div>
    </div>
  </body>
</html>
